<?php
ini_set('memory_limit', '512M');
require_once '/data/wwwroot/g_vendor/autoload.php';

use Biz\model\ShopSpecial as mShopSpecial;
use Biz\tools\Mail;

if ($argv[1] && $argv[2] && $argv[3]) {
    $specialId = $argv[1];
    $specialBanner = $argv[2];
    $linkUrl = $argv[3];
} else {
    $specialId = 261;
    $specialBanner = '70ea030ku03c0Fp00pjgvc9';
    $linkUrl = 'https://t.haohaozhu.com/h5_activityPage/?page_id=72&in_app=1';
}

$result = mShopSpecial::updateSpecialInfoById($specialId, ['special_banner' => $specialBanner, 'link_url' => $linkUrl]);
$sendMail = [
    'tangyiwan@haohaozhu.com',
    'yangjing@haohaozhu.com',
];
if ($result) {
    var_dump($result);
    Mail::send($sendMail, '更改活动' . $specialId . '图片和链接成功', '更改活动图片和链接成功:' . $result . '链接地址：' . $linkUrl);
} else {
    var_dump(mShopSpecial::log());
    Mail::send($sendMail, '更改活动' . $specialId . '图片和链接失败', '更改活动图片和链接失败:' . $result);
}
die;
